#region Using
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
#endregion Using

namespace PhotoGallery.Core.Business
{
    [Serializable]
	public class Location : Business.BusinessBase<Location, int>
	{
		#region Fields and Properties

		private String description = String.Empty;
		/// <summary>
		/// 
		/// </summary>
		public String Description
		{
			get { return description; }
			set
			{
				if (value != description)
				{
					MarkChanged("Description");
					description = value;
				}
			}
		}

		private String name = String.Empty;
		/// <summary>
		/// 
		/// </summary>
		public String Name
		{
			get { return name; }
			set
			{
				if (value != name)
				{
					MarkChanged("Name");
					name = value;
				}
			}
		}

		#endregion Fields and Properties

		#region Constructors

		public Location()
		{
		}

		#endregion Constructors

		#region Base overrides

		protected override void ValidationRules()
		{
		}

		protected override Location DataSelect(int id)
		{
			return Services.DALService.LocationService.Select(id);
		}

		protected override void DataUpdate()
		{
			Services.DALService.LocationService.Update(this);
		}

		protected override void DataInsert()
		{
			Services.DALService.LocationService.Insert(this);
		}

		protected override void DataDelete()
		{
			Services.DALService.LocationService.Delete(this);
		}

		#endregion Base overrides

        public static ICollection<Location> Search(string s)
        {
            return Services.DALService.LocationService.Search(s);
        }
        public static IList<Core.Business.Location> GetAll()
        {
            return Services.DALService.LocationService.GetAll();
        }
    }
}
